﻿using System;
using UnityEngine;
using FrameOperateSync;
using RenderMode = FrameOperateSync.RenderMode;

public class UnitySyncClient : MonoBehaviour, ISyncClient
{
    [SerializeField, Header("所有玩家ids")]
    private int[] allPlayerIds = null;
    [SerializeField, Header("自己id")]
    private int clientPlayerId = 0;
    [SerializeField, Header("网络")]
    private ISyncNetwork syncNetwork;
    [SerializeField, Header("渲染模式")]
    private FrameOperateSync.RenderMode renderMode;

    public int LocalPlayerId => clientPlayerId;

    protected virtual void Awake()
    {
        //Application.runInBackground = true;

        HelperUtility.SetFrameParser(new AGameSyncParser());
        HelperUtility.SetLogger(new AGameSyncLoger());
      //  ClientRunningEvent.EventRolePick += (pid) => { clientPlayerId = pid; };
    }

    protected virtual void Start()
    {
    }

    public virtual void OnSyncBegin()
    {
        Debug.LogError("OnSyncBegin");
    }

    public virtual void OnSyncInit()
    {
        Debug.Log("OnSyncInit");
    }

    public virtual void OnSyncPause()
    {
        Debug.Log("OnSyncPause");
    }

    public virtual void OnSyncResume()
    {
        Debug.Log("OnSyncResume");
    }

    public virtual void OnSyncStop()
    {
        Debug.Log("OnSyncStop");
    }

    public virtual void OnSyncUpdate(int frameIndex)
    {
    }
}

